// Search的小仓库
import {reqSearchList} from "@/api";

const state = {
    searchList:{}
};
const actions = {
    async getSearchList({commit},params={}){
        const result = await reqSearchList(params);
        if(result.code==200) {
            commit("GETSEARCHLIST", result.data);
        }
    }
};
const mutations = {
    GETSEARCHLIST(state,data){
        state.searchList=data
    }
}
const getters = {
    attrsList(state){
        return state.searchList.attrsList||[];
    },
    goodsList(state){
        return state.searchList.goodsList||[];

    },
    trademarkList(state){
        return state.searchList.trademarkList||[];
    }
}

export default {
    namespaced: true,
    state,
    actions,
    mutations,
    getters
}